<!--<!DOCTYPE html>-->
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <title>数据表格页面</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}" />
    <link rel="stylesheet" th:href="@{/css/bootstrap-responsive.min.css}" />
    <link rel="stylesheet" th:href="@{/css/uniform.css}" />
    <link rel="stylesheet" th:href="@{/css/select2.css}" />
    <link rel="stylesheet" th:href="@{/css/matrix-style.css}" />
    <link rel="stylesheet" th:href="@{/css/matrix-media.css}" />
    <link th:href="@{/css/font-awesome.css}" rel="stylesheet" />
    <script th:src="@{/js/jquery.js}"></script>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
</head>
<body>

<!--<div id="content">-->
<!--    <div id="content-header">-->
<!--        <div id="breadcrumb"> <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a> <a href="#" class="current">Tables</a> </div>-->
<!--        <h1>Tables</h1>-->
<!--    </div>-->
<!--    <div class="container-fluid">-->
<!--        <hr>-->
<!--        <div class="row-fluid">-->
<!--            <div class="span12">-->

<!--                </div>-->
                <div class="widget-box">
                    <div class="widget-title" th:height="50px"> <span class="icon">
            <input type="checkbox" id="title-checkbox" name="title-checkbox" />
            </span>
                        <h4 align="center">车辆订单信息</h4>
                    </div>
                    <div class="widget-content nopadding">
                            <table class="table table-bordered table-striped with-check">
                            <thead>
                            <tr>
                                <th><i class="icon-resize-vertical"></i></th>
<!--                                <th>订单编号</th>-->
                                <th>汽车品牌</th>
                                <th>汽车型号</th>
                                <th>汽车售价</th>
                                <th>销售人员</th>
                                <th>销售人员编号</th>
                                <th>销售时间</th>
                                <th>付款类型</th>
                                <th>提成</th>
                            </tr>
                            </thead>
                            <tr th:each="one:${PageInfo.list}">
                                <td><input type="checkbox"
                                           th:text="${PageInfo.pageSize * (PageInfo.pageNum - 1) + oneStat.count}"
                                           th:value="${one.orderId}"/>
                                </td>
<!--                                <td th:text="${one.order_Id}"></td>-->
                                <td th:text="${one.brand}"></td>
                                <td th:text="${one.type}"></td>
                                <td th:text="${one.sellingPrice}"></td>
                                <td th:text="${one.salesmanName}"></td>
                                <td th:text="${one.salesmanId}"></td>
                                <td th:text="${one.sellingTime}"></td>
                                <td th:text="${one.payment}"></td>
                                <td th:text="${one.royalty}"></td>
                                <td>
                                    <div class="button-group">
                                        <a class="button border-main"><span class="icon-edit">
                                        </span>修改</a>

                                        <a class="button border-red" href="javascript:void(0)" th:onclick="del([[${one.orderId}]])"><span class="icon-trash-o">
                                        </span>删除</a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="15">
                                    <p align="center">当前第 <span th:text="${PageInfo.pageNum}"></span> 页,总 <span th:text="${PageInfo.pages}"></span> 页,共 <span th:text="${PageInfo.total}"></span> 条记录</p>
                                    <div class="pagelist" align="center">
                                        <a th:href="@{/order/pageOrder}">首页</a>
                                        <a th:href="@{/order/pageOrder(pageNum=${PageInfo.hasPreviousPage}?${PageInfo.prePage}:1)}">上一页</a>
                                        <a th:href="@{/order/pageOrder(pageNum=${PageInfo.hasNextPage}?${PageInfo.nextPage}:${PageInfo.pages})}">下一页</a>
                                        <a th:href="@{/order/pageOrder(pageNum=${PageInfo.pages})}">尾页</a></div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
</body>
<script th:inline="javascript">
    function del(orderId) {
        if (confirm("您确定要删除吗")){
            $.ajax({
                url:[[@{/order/deleteOne}]],
            type: "post",
                data:{
                "orderId":orderId
            },
            success:function (data) {
                if (data.status == 200) {
                    alert(data.message);
                    location.reload();
                } else {
                    alert(data.message)
                }
            }

        });

        }

    }

</script>
<!--<script>-->
<!--    var total = 0;//总条数-->
<!--    var totalPages = 0;//总页数-->
<!--    var visiblePages = 5;//显示的页码数-->
<!--    var currentPage = 0;//当前页码-->
<!--    $(document).ready(function () {-->
<!--        showPage(-1)-->
<!--        $('#pagination1').jqPaginator({-->
<!--            totalPages: totalPages,-->
<!--            visiblePages: visiblePages,-->
<!--            currentPage: currentPage,-->
<!--            totalCounts: total,-->
<!--            first: '<li class="first"><a href="javascript:void(0);">第一页</a></li>',-->
<!--            prev: '<li class="prev"><a href="javascript:void(0);">前一页</a></li>',-->
<!--            next: '<li class="next"><a href="javascript:void(0);">下一页</a></li>',-->
<!--            last: '<li class="last"><a href="javascript:void(0);">最后一页</a></li>',-->
<!--            page: '<li class="page"><a href="javascript:void(0);">{{page}}</a></li>',-->
<!--            onPageChange: function (num) {-->
<!--                /* num代表改变过后的页码 */-->
<!--                showPage(num);-->
<!--            }-->
<!--        });-->
<!--    });-->
<!--    function showPage(n) {-->
<!--        $.ajax({-->
<!--            url:[[@{/order/pageOrder}]],-->
<!--            type:"get",-->
<!--            data:{"pageNum":n,"pageSize":5}-->
<!--            success:function(data){-->
<!--            console.log("返回结果"+data);-->
<!--            if(n==-1){/*理解为第一次访问 ，初始化全局变量 */-->
<!--                total = data.total;-->
<!--                totalPages = data.pages;-->
<!--                currentPage = data.pageNum;-->
<!--            }-->
<!--            $("#tab").html("");-->
<!--            if(data.list.length>0){-->
<!--                //使用jquery形式遍历-->
<!--                $.each(data.list,function(n,val){-->
<!--                    var str = "";-->
<!--                    str += "<tr>" +-->
<!--                        "<td>" + n + "</td>" +-->
<!--                        "<td>" + val.order_id+ "</td>" +-->
<!--                        "<td>" + val.brand + "</td>" +-->
<!--                        "<td>" + val.type + "</td>" +-->
<!--                        "<td>" + val.selling_price + "</td>" +-->
<!--                        "<td>" + val.salesman_name + "</td>" +-->
<!--                        "<td>" + val.salesman_id + "</td>" +-->
<!--                        "<td>" + val.selling_time + "</td>" +-->
<!--                        "<td>" + val.payment + "</td>" +-->
<!--                        "<td>" + val.royalty + "</td>" +-->
<!--                        "<td><a class=\"btn btn-default\" role=\"button\" onclick=\''>删除</a><a class=\"btn btn-default\" role=\"button\" onclick='' >修改</a></td>"-->
<!--                    $("#tab").append(str);-->
<!--                });-->
<!--            }else{-->
<!--                $("#tab").append("<tr><td colspan=8 align=\"center\">暂时没有数据哦，快去添加一条吧</td></tr>");-->
<!--            }-->
<!--        },-->
<!--        error:function(){-->
<!--            alert("服务器出错！");-->
<!--        }-->
<!--        })-->
<!--    }-->



</html>
